<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.16"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>LibTools: H:/project/LibTools/src/framework/tcp/framework/ClientServer.cpp 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">LibTools
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.16 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','搜索');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_5752cadd8276ecfd63d9b924f2a4d4b5.html">framework</a></li><li class="navelem"><a class="el" href="dir_c67741c6509c9bd4aec6faa9fd694608.html">tcp</a></li><li class="navelem"><a class="el" href="dir_cf0ab36ee90451b75992f2af7ab5af86.html">framework</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">ClientServer.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_client_server_8cpp.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#include &quot;../../../socket/internal/IoPortService.h&quot;</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#include &quot;../../../socket/TcpIoClient.h&quot;</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &quot;../../../socket/TcpIoSocket.h&quot;</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &quot;../../../socket/Timer.h&quot;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &quot;../../../log/LogFactory.h&quot;</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &quot;../ClassFactory.h&quot;</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_client_server_8h.html">ClientServer.h</a>&quot;</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="framework_2tcp_2framework_2_macro_tools_8h.html">MacroTools.h</a>&quot;</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_client_8h.html">Client.h</a>&quot;</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160; </div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<a class="code" href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160; </div>
<div class="line"><a name="l00013"></a><span class="lineno"><a class="line" href="class_client_server.html#aa81dcdd56f7f3e0c4dbaebe14b7f16f9">   13</a></span>&#160;<a class="code" href="class_client_server.html#aa81dcdd56f7f3e0c4dbaebe14b7f16f9">ClientServer::ClientServer</a>() :_tcpClient(new <a class="code" href="class_c_tcp_io_client.html">CTcpIoClient</a>())</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;{</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;    <a class="code" href="class_service.html#a83c9735b06c1d6bd177cb0b8d04ce038">_isServer</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;}</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160; </div>
<div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="class_client_server.html#a3f97d801ccbee1344848c3b85f95e7fc">   18</a></span>&#160;<a class="code" href="class_client_server.html#a3f97d801ccbee1344848c3b85f95e7fc">ClientServer::~ClientServer</a>()</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;{</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160; </div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;}</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160; </div>
<div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="class_client_server.html#a0042e91d55d5400b127e32be4e2500a7">   23</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_client_server.html#a0042e91d55d5400b127e32be4e2500a7">ClientServer::Init</a>(<span class="keyword">const</span> <a class="code" href="class_tcp_config.html">TcpConfig</a>&amp; c)</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;{</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;    *<a class="code" href="class_service.html#ac215518825547a80c089e9166d4f5e72">_config</a> = c;</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160; </div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;}</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160; </div>
<div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="class_client_server.html#a7fb112bc3fb44a2e2f3f8f466a6eb56e">   30</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_client_server.html#a7fb112bc3fb44a2e2f3f8f466a6eb56e">ClientServer::Run</a>()</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;{</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_client_server.html#ad39a839fc6009ef2c99325121c17d099">_tcpClient</a>-&gt;<a class="code" href="class_c_tcp_io_client.html#adab0eb30871fb90cd4806061cd3f9c8f">Run</a>();</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;}</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160; </div>
<div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="class_client_server.html#aad971e40b6fd6447bba55ca992b0e309">   35</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_client_server.html#aad971e40b6fd6447bba55ca992b0e309">ClientServer::NotifyExit</a>()</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;{</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_client_server.html#ad39a839fc6009ef2c99325121c17d099">_tcpClient</a>-&gt;<a class="code" href="class_c_tcp_io_client.html#aad1b0557e09e101c003ae36c7aea8d30">NotifyStop</a>();</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;}</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160; </div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="class_client_server.html#af8489c6cf441bd12e48c4c1421c7c6cf">   40</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_client_server.html#af8489c6cf441bd12e48c4c1421c7c6cf">ClientServer::SetClient</a>(<span class="keyword">const</span> <a class="code" href="class_shared_ptr.html">SharedPtr&lt;Client&gt;</a>&amp; c)</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;{</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    c-&gt;<a class="code" href="class_client.html#a5922d4b508779e8788fdbd3a6d137b01">_service</a> = <span class="keyword">this</span>;</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    c-&gt;<a class="code" href="class_client.html#ab206b489dcd55b5397b6360b62dbb22e">_isClose</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;    c-&gt;<a class="code" href="class_client.html#ac9ef3d3342a564f93d6d94ee795a28c0">_cliSock</a>.<a class="code" href="class_shared_ptr.html#a0b0a4c8396bf40f91994f729855c0a5a">Reset</a>(<span class="keyword">new</span> <a class="code" href="class_c_tcp_io_socket.html">CTcpIoSocket</a>(<a class="code" href="class_client_server.html#ad39a839fc6009ef2c99325121c17d099">_tcpClient</a>.<a class="code" href="class_shared_ptr.html#a0f15d2d3d2834b0667791f3abfd9e0d7">Get</a>()));</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;    c-&gt;<a class="code" href="class_client.html#aeed5abe9b4741420e5abe29b42c4f621">_timer</a>.<a class="code" href="class_shared_ptr.html#a0b0a4c8396bf40f91994f729855c0a5a">Reset</a>(<span class="keyword">new</span> <a class="code" href="class_c_timer.html">CTimer</a>(<a class="code" href="class_client_server.html#ad39a839fc6009ef2c99325121c17d099">_tcpClient</a>-&gt;<a class="code" href="class_c_tcp_io_client.html#a5e7895d97e4c364c67b6cdd0790f29ea">GetTcpServicePtr</a>()));</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;    <span class="keywordflow">if</span> (this-&gt;<a class="code" href="class_service.html#ac215518825547a80c089e9166d4f5e72">_config</a>-&gt;<a class="code" href="class_tcp_config.html#adc8a522e63eff042bf08252904830918">_timeout</a> != 0) c-&gt;<a class="code" href="class_client.html#adfe1866466f5be9eca92dd6319eb56c1">SetTimeout</a>(<a class="code" href="class_c_unit_time.html">CUnitTime</a>(this-&gt;<a class="code" href="class_service.html#ac215518825547a80c089e9166d4f5e72">_config</a>-&gt;<a class="code" href="class_tcp_config.html#adc8a522e63eff042bf08252904830918">_timeout</a>));</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    c-&gt;<a class="code" href="class_client.html#ace69bff65ba9f595115c1b80e10f687c">SetSocketOpt</a>(c-&gt;<a class="code" href="class_client.html#ac9ef3d3342a564f93d6d94ee795a28c0">_cliSock</a>.<a class="code" href="class_shared_ptr.html#a0f15d2d3d2834b0667791f3abfd9e0d7">Get</a>());</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    this-&gt;<a class="code" href="class_service.html#aceb078ac7bb78b45f21e0a3d2bf79735">AddClient</a>(c);</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;}</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160; </div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="class_client_server.html#a1bb203df5c04d7b940092047e7f2668e">   51</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_client_server.html#a1bb203df5c04d7b940092047e7f2668e">ClientServer::PostConnect</a>(<span class="keywordtype">void</span>* invoker <span class="comment">/* = NullPtr */</span>, <span class="keyword">const</span> <span class="keywordtype">char</span>* addr <span class="comment">/* = NullPtr */</span>, <a class="code" href="tools_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a> port <span class="comment">/* = 0 */</span>)</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;{</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    <a class="code" href="class_shared_ptr.html">SharedPtr&lt;Client&gt;</a> c(<a class="code" href="class_service.html#ac215518825547a80c089e9166d4f5e72">_config</a>-&gt;<a class="code" href="class_tcp_config.html#a41473b0f5b097059e3e9b38df132928b">_clientFactory</a>-&gt;<a class="code" href="class_client_factory.html#a2c25b038c71194786ee5a1dbd21d5f79">GetClient</a>(), <a class="code" href="struct_release_client.html">ReleaseClient</a>(<a class="code" href="class_service.html#ac215518825547a80c089e9166d4f5e72">_config</a>-&gt;<a class="code" href="class_tcp_config.html#a41473b0f5b097059e3e9b38df132928b">_clientFactory</a>.<a class="code" href="class_shared_ptr.html#a0f15d2d3d2834b0667791f3abfd9e0d7">Get</a>()));</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    c-&gt;<a class="code" href="class_client.html#a4889e8635ac9c85685cca164608dc4f8">_invoker</a> = invoker;</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    <a class="code" href="class_client_server.html#af8489c6cf441bd12e48c4c1421c7c6cf">SetClient</a>(c);</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    c-&gt;<a class="code" href="class_client.html#ac9ef3d3342a564f93d6d94ee795a28c0">_cliSock</a>-&gt;<a class="code" href="class_c_socket.html#aafc3fc3ab0c1e3d5ae2cf9dfba46d442">SetDomain</a>(<a class="code" href="class_service.html#ac215518825547a80c089e9166d4f5e72">_config</a>-&gt;<a class="code" href="class_tcp_config.html#aeea34692ee7ba49257448a3088d73b61">_family</a>);</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    c-&gt;<a class="code" href="class_client.html#ac9ef3d3342a564f93d6d94ee795a28c0">_cliSock</a>-&gt;<a class="code" href="class_c_socket.html#afaa6fee02d3a38224445cb42d63d3521">SetAddr</a>(addr);</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    c-&gt;<a class="code" href="class_client.html#ac9ef3d3342a564f93d6d94ee795a28c0">_cliSock</a>-&gt;<a class="code" href="class_c_socket.html#a112e126a842b4ec30e5d17721ebe73cb">SetPort</a>(port);</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    <a class="code" href="class_c_sock_error.html">CSockError</a> ec = <a class="code" href="class_client_server.html#ad39a839fc6009ef2c99325121c17d099">_tcpClient</a>-&gt;<a class="code" href="class_c_tcp_io_client.html#ab6fce95f05e531d5c3a5d6a020b009ed">Init</a>(*c-&gt;<a class="code" href="class_client.html#ac9ef3d3342a564f93d6d94ee795a28c0">_cliSock</a>);</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    <a class="code" href="_log_factory_8h.html#a3bcb3081cc092adc9e13acb28e70d9e0">LOG_TOOLS</a>(<a class="code" href="logdef_8h.html#aca1fd1d8935433e6ba2e3918214e07f9abb2c17c44c343a8367060db4175f39ea">LOG_NORMAL</a>) &lt;&lt; <span class="stringliteral">&quot;PostConnect client_id:&quot;</span> &lt;&lt; c-&gt;<a class="code" href="class_client.html#aceeb18e407bb39e5368fa2ab27d66a88">GetClientIden</a>();</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    <span class="keywordflow">if</span> (!ec){</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;        <a class="code" href="class_client_server.html#ad39a839fc6009ef2c99325121c17d099">_tcpClient</a>-&gt;<a class="code" href="class_c_tcp_io_client.html#a5108d1e20ddf728920483c7c7b071e3f">AsyncConnect</a>(*c-&gt;<a class="code" href="class_client.html#ac9ef3d3342a564f93d6d94ee795a28c0">_cliSock</a>, <a class="code" href="class_client_server.html#aba3869c3d20879ecff2d264479b7a2d5">ClientServer::ConnectComplete</a>, c.<a class="code" href="class_shared_ptr.html#a0f15d2d3d2834b0667791f3abfd9e0d7">Get</a>());</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    }</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    <span class="keywordflow">else</span></div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    {</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;        c-&gt;<a class="code" href="class_client.html#aa9714e538888d94b2c9c2acc1a4f4a68">Post</a>(&amp;<a class="code" href="class_client_server.html#a2f64fcd3a85d6afe01eec868ae928b72">ClientServer::ConnectFailed</a>, c.<a class="code" href="class_shared_ptr.html#a0f15d2d3d2834b0667791f3abfd9e0d7">Get</a>());</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;        <a class="code" href="_log_factory_8h.html#a3bcb3081cc092adc9e13acb28e70d9e0">LOG_TOOLS</a>(<a class="code" href="logdef_8h.html#aca1fd1d8935433e6ba2e3918214e07f9a230506cce5c68c3bac5a821c42ed3473">LOG_ERROR</a>) &lt;&lt; <span class="stringliteral">&quot;init socket failed:&quot;</span> &lt;&lt; c.<a class="code" href="class_shared_ptr.html#a0f15d2d3d2834b0667791f3abfd9e0d7">Get</a>() &lt;&lt; <span class="stringliteral">&quot;, addr:&quot;</span> &lt;&lt; addr &lt;&lt; <span class="stringliteral">&quot;, port:&quot;</span> &lt;&lt; port &lt;&lt; <span class="stringliteral">&quot;, msg:&quot;</span> &lt;&lt; ec.GetErrorMsg();</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    }</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;}</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160; </div>
<div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="class_client_server.html#acd4373ea16097009de3cda8d51e64719">   71</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_client_server.html#acd4373ea16097009de3cda8d51e64719">ClientServer::Post</a>(<a class="code" href="tools_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a>(*complete)(<span class="keywordtype">void</span>*), <span class="keywordtype">void</span>* invoker)</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;{</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    <a class="code" href="class_client_server.html#ad39a839fc6009ef2c99325121c17d099">_tcpClient</a>-&gt;<a class="code" href="class_c_tcp_io_client.html#a14c502b0d90ceb4d20828f8b878ee4ce">Post</a>(complete, invoker);</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;}</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160; </div>
<div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="class_client_server.html#a17b41665a35c32ba39833c98e4ca99bd">   76</a></span>&#160;<span class="keywordtype">int</span> <a class="code" href="class_client_server.html#a17b41665a35c32ba39833c98e4ca99bd">ClientServer::DealConnect</a>(<a class="code" href="class_client.html">Client</a>* c, <span class="keyword">const</span> <span class="keywordtype">char</span>* msg, <span class="keywordtype">void</span>* invoker)</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;{</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    <span class="keywordflow">if</span> (c){</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;        c-&gt;<a class="code" href="class_client.html#a95dc32ad76a8bde7a525408d03b842ed">Start</a>(invoker);</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;        c-&gt;<a class="code" href="class_client.html#aaf6a8239f1f36ef898d289860d7dacb3">Close</a>();</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    }</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160; </div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;}</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160; </div>
<div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="class_client_server.html#aba3869c3d20879ecff2d264479b7a2d5">   86</a></span>&#160;<a class="code" href="tools_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a> <a class="code" href="class_client_server.html#aba3869c3d20879ecff2d264479b7a2d5">ClientServer::ConnectComplete</a>(<a class="code" href="class_c_sock_error.html">CSockError</a> ec, <span class="keywordtype">void</span>* invoker)</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;{</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    <a class="code" href="class_client.html">Client</a>* c = (<a class="code" href="class_client.html">Client</a>*)invoker;</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    <a class="code" href="tools_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a> ret = 0;</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160; </div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    <span class="keywordflow">if</span> (ec)</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    {</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;        <a class="code" href="_log_factory_8h.html#a3bcb3081cc092adc9e13acb28e70d9e0">LOG_TOOLS</a>(<a class="code" href="logdef_8h.html#aca1fd1d8935433e6ba2e3918214e07f9a230506cce5c68c3bac5a821c42ed3473">LOG_ERROR</a>) &lt;&lt; <span class="stringliteral">&quot;DealConnect error:&quot;</span> &lt;&lt; ec.GetErrorMsg() &lt;&lt; <span class="stringliteral">&quot;, client_id:&quot;</span> &lt;&lt; c-&gt;<a class="code" href="class_client.html#aceeb18e407bb39e5368fa2ab27d66a88">GetClientIden</a>();</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;        ret = dynamic_cast&lt;ClientServer*&gt;(c-&gt;<a class="code" href="class_client.html#a5922d4b508779e8788fdbd3a6d137b01">_service</a>)-&gt;DealConnect(c, ec.GetErrorMsg().c_str(), c-&gt;<a class="code" href="class_client.html#a4889e8635ac9c85685cca164608dc4f8">_invoker</a>);</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;        c-&gt;<a class="code" href="class_client.html#aaf6a8239f1f36ef898d289860d7dacb3">Close</a>();</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    }</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    <span class="keywordflow">else</span>{</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;        ret = dynamic_cast&lt;ClientServer*&gt;(c-&gt;<a class="code" href="class_client.html#a5922d4b508779e8788fdbd3a6d137b01">_service</a>)-&gt;DealConnect(c, <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>, c-&gt;<a class="code" href="class_client.html#a4889e8635ac9c85685cca164608dc4f8">_invoker</a>);</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    }</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160; </div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <span class="keywordflow">return</span> ret;</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;}</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160; </div>
<div class="line"><a name="l00104"></a><span class="lineno"><a class="line" href="class_client_server.html#a2f64fcd3a85d6afe01eec868ae928b72">  104</a></span>&#160;<a class="code" href="tools_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a> <a class="code" href="class_client_server.html#a2f64fcd3a85d6afe01eec868ae928b72">ClientServer::ConnectFailed</a>(<span class="keywordtype">void</span>* invoker)</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;{</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    <a class="code" href="class_c_sock_error.html">CSockError</a> ec(<a class="code" href="namespace_s_o_c_k_e_t_s_t_a_t_u_s.html#a960fa087f22eb32da3c7d0c805be7876a5a76b20cc3c857f53d6e5e7e817c8959">CSockError::UNINIT</a>);</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_client_server.html#aba3869c3d20879ecff2d264479b7a2d5">ConnectComplete</a>(ec, invoker);</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;}</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160; </div>
<div class="line"><a name="l00110"></a><span class="lineno"><a class="line" href="class_client_server.html#a3f88a8505fd02dba1337cd974a511f39">  110</a></span>&#160;<a class="code" href="class_c_basic_service.html">CBasicService</a>* <a class="code" href="class_client_server.html#a3f88a8505fd02dba1337cd974a511f39">ClientServer::GetTcpService</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_client_server.html#ad39a839fc6009ef2c99325121c17d099">_tcpClient</a>-&gt;<a class="code" href="class_c_tcp_io_client.html#a5e7895d97e4c364c67b6cdd0790f29ea">GetTcpServicePtr</a>();</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;}</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160; </div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;<a class="code" href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclass_c_socket_html_a112e126a842b4ec30e5d17721ebe73cb"><div class="ttname"><a href="class_c_socket.html#a112e126a842b4ec30e5d17721ebe73cb">CSocket::SetPort</a></div><div class="ttdeci">virtual void SetPort(DWORD port)</div><div class="ttdoc">设置远程或本地端口</div><div class="ttdef"><b>Definition:</b> <a href="_socket_8cpp_source.html#l00166">Socket.cpp:166</a></div></div>
<div class="ttc" id="aclass_tcp_config_html_a41473b0f5b097059e3e9b38df132928b"><div class="ttname"><a href="class_tcp_config.html#a41473b0f5b097059e3e9b38df132928b">TcpConfig::_clientFactory</a></div><div class="ttdeci">SharedPtr&lt; ClientFactory &gt; _clientFactory</div><div class="ttdoc">客户端类工厂</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_conf_8h_source.html#l00044">TcpConf.h:44</a></div></div>
<div class="ttc" id="aclass_client_server_html_af8489c6cf441bd12e48c4c1421c7c6cf"><div class="ttname"><a href="class_client_server.html#af8489c6cf441bd12e48c4c1421c7c6cf">ClientServer::SetClient</a></div><div class="ttdeci">void SetClient(const SharedPtr&lt; Client &gt; &amp;c)</div><div class="ttdef"><b>Definition:</b> <a href="_client_server_8cpp_source.html#l00040">ClientServer.cpp:40</a></div></div>
<div class="ttc" id="aclass_client_server_html_aba3869c3d20879ecff2d264479b7a2d5"><div class="ttname"><a href="class_client_server.html#aba3869c3d20879ecff2d264479b7a2d5">ClientServer::ConnectComplete</a></div><div class="ttdeci">static DWORD ConnectComplete(CSockError ec, void *invoker)</div><div class="ttdef"><b>Definition:</b> <a href="_client_server_8cpp_source.html#l00086">ClientServer.cpp:86</a></div></div>
<div class="ttc" id="aclass_c_sock_error_html"><div class="ttname"><a href="class_c_sock_error.html">CSockError</a></div><div class="ttdoc">套接字错误信息类</div><div class="ttdef"><b>Definition:</b> <a href="_sock_error_8h_source.html#l00013">SockError.h:13</a></div></div>
<div class="ttc" id="aclass_c_socket_html_afaa6fee02d3a38224445cb42d63d3521"><div class="ttname"><a href="class_c_socket.html#afaa6fee02d3a38224445cb42d63d3521">CSocket::SetAddr</a></div><div class="ttdeci">virtual void SetAddr(const char *addr)</div><div class="ttdoc">设置远程或本地地址</div><div class="ttdef"><b>Definition:</b> <a href="_socket_8cpp_source.html#l00171">Socket.cpp:171</a></div></div>
<div class="ttc" id="aclass_client_server_html_ad39a839fc6009ef2c99325121c17d099"><div class="ttname"><a href="class_client_server.html#ad39a839fc6009ef2c99325121c17d099">ClientServer::_tcpClient</a></div><div class="ttdeci">SharedPtr&lt; CTcpIoClient &gt; _tcpClient</div><div class="ttdef"><b>Definition:</b> <a href="_client_server_8h_source.html#l00059">ClientServer.h:59</a></div></div>
<div class="ttc" id="aclass_c_tcp_io_client_html_ab6fce95f05e531d5c3a5d6a020b009ed"><div class="ttname"><a href="class_c_tcp_io_client.html#ab6fce95f05e531d5c3a5d6a020b009ed">CTcpIoClient::Init</a></div><div class="ttdeci">CSockError Init(CTcpIoSocket &amp;sock, bool isServer=false)</div><div class="ttdoc">初始化套接字与服务类设备进行绑定</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_io_client_8h_source.html#l00032">TcpIoClient.h:32</a></div></div>
<div class="ttc" id="aclass_c_socket_html_aafc3fc3ab0c1e3d5ae2cf9dfba46d442"><div class="ttname"><a href="class_c_socket.html#aafc3fc3ab0c1e3d5ae2cf9dfba46d442">CSocket::SetDomain</a></div><div class="ttdeci">virtual void SetDomain(SOCKFAMILY::SockFamily domain=SOCKFAMILY::IPV4)</div><div class="ttdoc">设置协议族,注意重置该值将会清空地址、端口信息</div><div class="ttdef"><b>Definition:</b> <a href="_socket_8cpp_source.html#l00181">Socket.cpp:181</a></div></div>
<div class="ttc" id="aclass_shared_ptr_html"><div class="ttname"><a href="class_shared_ptr.html">SharedPtr</a></div><div class="ttdoc">智能指针</div><div class="ttdef"><b>Definition:</b> <a href="_shared_ptr_8h_source.html#l00119">SharedPtr.h:119</a></div></div>
<div class="ttc" id="aclass_client_html_aeed5abe9b4741420e5abe29b42c4f621"><div class="ttname"><a href="class_client.html#aeed5abe9b4741420e5abe29b42c4f621">Client::_timer</a></div><div class="ttdeci">SharedPtr&lt; CTimer &gt; _timer</div><div class="ttdef"><b>Definition:</b> <a href="_client_8h_source.html#l00104">Client.h:104</a></div></div>
<div class="ttc" id="aclass_shared_ptr_html_a0f15d2d3d2834b0667791f3abfd9e0d7"><div class="ttname"><a href="class_shared_ptr.html#a0f15d2d3d2834b0667791f3abfd9e0d7">SharedPtr::Get</a></div><div class="ttdeci">Ty * Get()</div><div class="ttdef"><b>Definition:</b> <a href="_shared_ptr_8h_source.html#l00202">SharedPtr.h:202</a></div></div>
<div class="ttc" id="aclass_client_html_a4889e8635ac9c85685cca164608dc4f8"><div class="ttname"><a href="class_client.html#a4889e8635ac9c85685cca164608dc4f8">Client::_invoker</a></div><div class="ttdeci">void * _invoker</div><div class="ttdef"><b>Definition:</b> <a href="_client_8h_source.html#l00105">Client.h:105</a></div></div>
<div class="ttc" id="aclass_client_server_html_aa81dcdd56f7f3e0c4dbaebe14b7f16f9"><div class="ttname"><a href="class_client_server.html#aa81dcdd56f7f3e0c4dbaebe14b7f16f9">ClientServer::ClientServer</a></div><div class="ttdeci">ClientServer()</div><div class="ttdef"><b>Definition:</b> <a href="_client_server_8cpp_source.html#l00013">ClientServer.cpp:13</a></div></div>
<div class="ttc" id="aclass_client_server_html_a7fb112bc3fb44a2e2f3f8f466a6eb56e"><div class="ttname"><a href="class_client_server.html#a7fb112bc3fb44a2e2f3f8f466a6eb56e">ClientServer::Run</a></div><div class="ttdeci">virtual bool Run()</div><div class="ttdoc">运行服务</div><div class="ttdef"><b>Definition:</b> <a href="_client_server_8cpp_source.html#l00030">ClientServer.cpp:30</a></div></div>
<div class="ttc" id="aclass_client_html_ab206b489dcd55b5397b6360b62dbb22e"><div class="ttname"><a href="class_client.html#ab206b489dcd55b5397b6360b62dbb22e">Client::_isClose</a></div><div class="ttdeci">bool _isClose</div><div class="ttdef"><b>Definition:</b> <a href="_client_8h_source.html#l00106">Client.h:106</a></div></div>
<div class="ttc" id="aclass_c_tcp_io_client_html_a5e7895d97e4c364c67b6cdd0790f29ea"><div class="ttname"><a href="class_c_tcp_io_client.html#a5e7895d97e4c364c67b6cdd0790f29ea">CTcpIoClient::GetTcpServicePtr</a></div><div class="ttdeci">CBasicService * GetTcpServicePtr()</div><div class="ttdoc">获取底层服务类</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_io_client_8h_source.html#l00133">TcpIoClient.h:133</a></div></div>
<div class="ttc" id="aclass_client_server_html_a3f97d801ccbee1344848c3b85f95e7fc"><div class="ttname"><a href="class_client_server.html#a3f97d801ccbee1344848c3b85f95e7fc">ClientServer::~ClientServer</a></div><div class="ttdeci">virtual ~ClientServer()</div><div class="ttdef"><b>Definition:</b> <a href="_client_server_8cpp_source.html#l00018">ClientServer.cpp:18</a></div></div>
<div class="ttc" id="atools_8h_html_a201ce692c9dca6599e5c12d00167419b"><div class="ttname"><a href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div><div class="ttdeci">#define DEF_BEG_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00036">tools.h:36</a></div></div>
<div class="ttc" id="aclass_client_server_html_aad971e40b6fd6447bba55ca992b0e309"><div class="ttname"><a href="class_client_server.html#aad971e40b6fd6447bba55ca992b0e309">ClientServer::NotifyExit</a></div><div class="ttdeci">virtual void NotifyExit()</div><div class="ttdoc">通知Run函数退出</div><div class="ttdef"><b>Definition:</b> <a href="_client_server_8cpp_source.html#l00035">ClientServer.cpp:35</a></div></div>
<div class="ttc" id="aclass_tcp_config_html"><div class="ttname"><a href="class_tcp_config.html">TcpConfig</a></div><div class="ttdoc">客户端配置类</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_conf_8h_source.html#l00018">TcpConf.h:18</a></div></div>
<div class="ttc" id="aclass_client_html_adfe1866466f5be9eca92dd6319eb56c1"><div class="ttname"><a href="class_client.html#adfe1866466f5be9eca92dd6319eb56c1">Client::SetTimeout</a></div><div class="ttdeci">virtual void SetTimeout(const CTimeBase &amp;t)</div><div class="ttdoc">设置超时,派生类可以重写此功能以便重设</div><div class="ttdef"><b>Definition:</b> <a href="_client_8cpp_source.html#l00116">Client.cpp:116</a></div></div>
<div class="ttc" id="aclass_c_tcp_io_client_html_a5108d1e20ddf728920483c7c7b071e3f"><div class="ttname"><a href="class_c_tcp_io_client.html#a5108d1e20ddf728920483c7c7b071e3f">CTcpIoClient::AsyncConnect</a></div><div class="ttdeci">void AsyncConnect(CTcpIoSocket &amp;sock, Func func)</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_io_client_8h_source.html#l00045">TcpIoClient.h:45</a></div></div>
<div class="ttc" id="aclass_service_html_ac215518825547a80c089e9166d4f5e72"><div class="ttname"><a href="class_service.html#ac215518825547a80c089e9166d4f5e72">Service::_config</a></div><div class="ttdeci">SharedPtr&lt; TcpConfig &gt; _config</div><div class="ttdoc">配置文件</div><div class="ttdef"><b>Definition:</b> <a href="_service_8h_source.html#l00114">Service.h:114</a></div></div>
<div class="ttc" id="aclass_c_tcp_io_client_html_adab0eb30871fb90cd4806061cd3f9c8f"><div class="ttname"><a href="class_c_tcp_io_client.html#adab0eb30871fb90cd4806061cd3f9c8f">CTcpIoClient::Run</a></div><div class="ttdeci">bool Run()</div><div class="ttdoc">运行服务</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_io_client_8h_source.html#l00108">TcpIoClient.h:108</a></div></div>
<div class="ttc" id="aclass_client_html_a95dc32ad76a8bde7a525408d03b842ed"><div class="ttname"><a href="class_client.html#a95dc32ad76a8bde7a525408d03b842ed">Client::Start</a></div><div class="ttdeci">virtual bool Start(void *invoker)</div><div class="ttdoc">开始任务，继承者可实现此函数进行处理</div><div class="ttdef"><b>Definition:</b> <a href="_client_8h_source.html#l00026">Client.h:26</a></div></div>
<div class="ttc" id="aclass_client_server_html_a1bb203df5c04d7b940092047e7f2668e"><div class="ttname"><a href="class_client_server.html#a1bb203df5c04d7b940092047e7f2668e">ClientServer::PostConnect</a></div><div class="ttdeci">virtual void PostConnect(void *invoker=NullPtr, const char *addr=NullPtr, DWORD port=0)</div><div class="ttdoc">投递一个接收请求，参数将会被忽略</div><div class="ttdef"><b>Definition:</b> <a href="_client_server_8cpp_source.html#l00051">ClientServer.cpp:51</a></div></div>
<div class="ttc" id="alogdef_8h_html_aca1fd1d8935433e6ba2e3918214e07f9abb2c17c44c343a8367060db4175f39ea"><div class="ttname"><a href="logdef_8h.html#aca1fd1d8935433e6ba2e3918214e07f9abb2c17c44c343a8367060db4175f39ea">LOG_NORMAL</a></div><div class="ttdef"><b>Definition:</b> <a href="logdef_8h_source.html#l00013">logdef.h:13</a></div></div>
<div class="ttc" id="aclass_c_unit_time_html"><div class="ttname"><a href="class_c_unit_time.html">CUnitTime</a></div><div class="ttdoc">时间单位类 以毫秒为单位的一个时间度量</div><div class="ttdef"><b>Definition:</b> <a href="_time_8h_source.html#l00170">Time.h:170</a></div></div>
<div class="ttc" id="aframework_2tcp_2framework_2_macro_tools_8h_html"><div class="ttname"><a href="framework_2tcp_2framework_2_macro_tools_8h.html">MacroTools.h</a></div></div>
<div class="ttc" id="aclass_client_server_html_a2f64fcd3a85d6afe01eec868ae928b72"><div class="ttname"><a href="class_client_server.html#a2f64fcd3a85d6afe01eec868ae928b72">ClientServer::ConnectFailed</a></div><div class="ttdeci">static DWORD ConnectFailed(void *invoker)</div><div class="ttdef"><b>Definition:</b> <a href="_client_server_8cpp_source.html#l00104">ClientServer.cpp:104</a></div></div>
<div class="ttc" id="atools_8h_html_ac909db71799bb22cb7d636a34cd785e4"><div class="ttname"><a href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div><div class="ttdeci">#define DEF_END_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00038">tools.h:38</a></div></div>
<div class="ttc" id="a_client_8h_html"><div class="ttname"><a href="_client_8h.html">Client.h</a></div></div>
<div class="ttc" id="aclass_client_factory_html_a2c25b038c71194786ee5a1dbd21d5f79"><div class="ttname"><a href="class_client_factory.html#a2c25b038c71194786ee5a1dbd21d5f79">ClientFactory::GetClient</a></div><div class="ttdeci">virtual Client * GetClient()=0</div><div class="ttdoc">生产一个client</div></div>
<div class="ttc" id="aclass_client_html_a5922d4b508779e8788fdbd3a6d137b01"><div class="ttname"><a href="class_client.html#a5922d4b508779e8788fdbd3a6d137b01">Client::_service</a></div><div class="ttdeci">Service * _service</div><div class="ttdef"><b>Definition:</b> <a href="_client_8h_source.html#l00107">Client.h:107</a></div></div>
<div class="ttc" id="aclass_shared_ptr_html_a0b0a4c8396bf40f91994f729855c0a5a"><div class="ttname"><a href="class_shared_ptr.html#a0b0a4c8396bf40f91994f729855c0a5a">SharedPtr::Reset</a></div><div class="ttdeci">void Reset(Ty *p)</div><div class="ttdef"><b>Definition:</b> <a href="_shared_ptr_8h_source.html#l00175">SharedPtr.h:175</a></div></div>
<div class="ttc" id="alogdef_8h_html_aca1fd1d8935433e6ba2e3918214e07f9a230506cce5c68c3bac5a821c42ed3473"><div class="ttname"><a href="logdef_8h.html#aca1fd1d8935433e6ba2e3918214e07f9a230506cce5c68c3bac5a821c42ed3473">LOG_ERROR</a></div><div class="ttdef"><b>Definition:</b> <a href="logdef_8h_source.html#l00015">logdef.h:15</a></div></div>
<div class="ttc" id="astruct_release_client_html"><div class="ttname"><a href="struct_release_client.html">ReleaseClient</a></div><div class="ttdef"><b>Definition:</b> <a href="_class_factory_8h_source.html#l00058">ClassFactory.h:58</a></div></div>
<div class="ttc" id="aclass_c_tcp_io_client_html_a14c502b0d90ceb4d20828f8b878ee4ce"><div class="ttname"><a href="class_c_tcp_io_client.html#a14c502b0d90ceb4d20828f8b878ee4ce">CTcpIoClient::Post</a></div><div class="ttdeci">void Post(Func func)</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_io_client_8h_source.html#l00098">TcpIoClient.h:98</a></div></div>
<div class="ttc" id="atools_8h_html_a798af1e30bc65f319c1a246cecf59e39"><div class="ttname"><a href="tools_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a></div><div class="ttdeci">unsigned int DWORD</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00134">tools.h:134</a></div></div>
<div class="ttc" id="aclass_client_html_aaf6a8239f1f36ef898d289860d7dacb3"><div class="ttname"><a href="class_client.html#aaf6a8239f1f36ef898d289860d7dacb3">Client::Close</a></div><div class="ttdeci">virtual void Close()</div><div class="ttdoc">关闭客户端</div><div class="ttdef"><b>Definition:</b> <a href="_client_8cpp_source.html#l00104">Client.cpp:104</a></div></div>
<div class="ttc" id="a_client_server_8h_html"><div class="ttname"><a href="_client_server_8h.html">ClientServer.h</a></div></div>
<div class="ttc" id="aclass_client_html_ace69bff65ba9f595115c1b80e10f687c"><div class="ttname"><a href="class_client.html#ace69bff65ba9f595115c1b80e10f687c">Client::SetSocketOpt</a></div><div class="ttdeci">virtual void SetSocketOpt(CTcpIoSocket *s)</div><div class="ttdoc">设置套接字选项, 派生类可重写此函数以设置更多的套接字选项</div><div class="ttdef"><b>Definition:</b> <a href="_client_8h_source.html#l00061">Client.h:61</a></div></div>
<div class="ttc" id="aclass_c_tcp_io_client_html"><div class="ttname"><a href="class_c_tcp_io_client.html">CTcpIoClient</a></div><div class="ttdoc">tcp io 客户端服务类</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_io_client_8h_source.html#l00011">TcpIoClient.h:11</a></div></div>
<div class="ttc" id="aclass_client_server_html_a0042e91d55d5400b127e32be4e2500a7"><div class="ttname"><a href="class_client_server.html#a0042e91d55d5400b127e32be4e2500a7">ClientServer::Init</a></div><div class="ttdeci">virtual bool Init(const TcpConfig &amp;c)</div><div class="ttdoc">初始化服务</div><div class="ttdef"><b>Definition:</b> <a href="_client_server_8cpp_source.html#l00023">ClientServer.cpp:23</a></div></div>
<div class="ttc" id="atools_8h_html_ab689500aaec0db066e3ac9483d3fe425"><div class="ttname"><a href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a></div><div class="ttdeci">#define NullPtr</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00119">tools.h:119</a></div></div>
<div class="ttc" id="aclass_c_tcp_io_client_html_aad1b0557e09e101c003ae36c7aea8d30"><div class="ttname"><a href="class_c_tcp_io_client.html#aad1b0557e09e101c003ae36c7aea8d30">CTcpIoClient::NotifyStop</a></div><div class="ttdeci">void NotifyStop()</div><div class="ttdoc">通知服务停止</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_io_client_8h_source.html#l00118">TcpIoClient.h:118</a></div></div>
<div class="ttc" id="aclass_c_timer_html"><div class="ttname"><a href="class_c_timer.html">CTimer</a></div><div class="ttdoc">定时器</div><div class="ttdef"><b>Definition:</b> <a href="_timer_8h_source.html#l00069">Timer.h:69</a></div></div>
<div class="ttc" id="aclass_client_html_aa9714e538888d94b2c9c2acc1a4f4a68"><div class="ttname"><a href="class_client.html#aa9714e538888d94b2c9c2acc1a4f4a68">Client::Post</a></div><div class="ttdeci">virtual bool Post(DWORD(*complete)(void *), void *invoker)</div><div class="ttdoc">异步投递一个完成</div><div class="ttdef"><b>Definition:</b> <a href="_client_8cpp_source.html#l00092">Client.cpp:92</a></div></div>
<div class="ttc" id="aclass_client_server_html_a17b41665a35c32ba39833c98e4ca99bd"><div class="ttname"><a href="class_client_server.html#a17b41665a35c32ba39833c98e4ca99bd">ClientServer::DealConnect</a></div><div class="ttdeci">virtual int DealConnect(Client *c, const char *msg, void *invoker)</div><div class="ttdoc">处理接收函数，子类可重写此处理</div><div class="ttdef"><b>Definition:</b> <a href="_client_server_8cpp_source.html#l00076">ClientServer.cpp:76</a></div></div>
<div class="ttc" id="aclass_c_basic_service_html"><div class="ttname"><a href="class_c_basic_service.html">CBasicService</a></div><div class="ttdoc">服务类 基类</div><div class="ttdef"><b>Definition:</b> <a href="_service_base_8h_source.html#l00015">ServiceBase.h:15</a></div></div>
<div class="ttc" id="a_log_factory_8h_html_a3bcb3081cc092adc9e13acb28e70d9e0"><div class="ttname"><a href="_log_factory_8h.html#a3bcb3081cc092adc9e13acb28e70d9e0">LOG_TOOLS</a></div><div class="ttdeci">#define LOG_TOOLS(LEVEL)</div><div class="ttdoc">日志流操作宏工具</div><div class="ttdef"><b>Definition:</b> <a href="_log_factory_8h_source.html#l00013">LogFactory.h:13</a></div></div>
<div class="ttc" id="aclass_client_html_aceeb18e407bb39e5368fa2ab27d66a88"><div class="ttname"><a href="class_client.html#aceeb18e407bb39e5368fa2ab27d66a88">Client::GetClientIden</a></div><div class="ttdeci">virtual std::string GetClientIden() const</div><div class="ttdoc">获取客户端唯一标识</div><div class="ttdef"><b>Definition:</b> <a href="_client_8cpp_source.html#l00046">Client.cpp:46</a></div></div>
<div class="ttc" id="aclass_client_server_html_a3f88a8505fd02dba1337cd974a511f39"><div class="ttname"><a href="class_client_server.html#a3f88a8505fd02dba1337cd974a511f39">ClientServer::GetTcpService</a></div><div class="ttdeci">virtual CBasicService * GetTcpService() const</div><div class="ttdoc">获取tcp底层类指针</div><div class="ttdef"><b>Definition:</b> <a href="_client_server_8cpp_source.html#l00110">ClientServer.cpp:110</a></div></div>
<div class="ttc" id="aclass_tcp_config_html_adc8a522e63eff042bf08252904830918"><div class="ttname"><a href="class_tcp_config.html#adc8a522e63eff042bf08252904830918">TcpConfig::_timeout</a></div><div class="ttdeci">int _timeout</div><div class="ttdoc">超时时间,单位毫秒，为0则不设置超时值</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_conf_8h_source.html#l00038">TcpConf.h:38</a></div></div>
<div class="ttc" id="aclass_c_tcp_io_socket_html"><div class="ttname"><a href="class_c_tcp_io_socket.html">CTcpIoSocket</a></div><div class="ttdoc">用于tcp进行io投递的套接字类</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_io_socket_8h_source.html#l00017">TcpIoSocket.h:17</a></div></div>
<div class="ttc" id="aclass_client_server_html_acd4373ea16097009de3cda8d51e64719"><div class="ttname"><a href="class_client_server.html#acd4373ea16097009de3cda8d51e64719">ClientServer::Post</a></div><div class="ttdeci">virtual void Post(DWORD(*complete)(void *), void *invoker)</div><div class="ttdoc">投递一个用户操作</div><div class="ttdef"><b>Definition:</b> <a href="_client_server_8cpp_source.html#l00071">ClientServer.cpp:71</a></div></div>
<div class="ttc" id="aclass_client_html"><div class="ttname"><a href="class_client.html">Client</a></div><div class="ttdef"><b>Definition:</b> <a href="_client_8h_source.html#l00012">Client.h:12</a></div></div>
<div class="ttc" id="anamespace_s_o_c_k_e_t_s_t_a_t_u_s_html_a960fa087f22eb32da3c7d0c805be7876a5a76b20cc3c857f53d6e5e7e817c8959"><div class="ttname"><a href="namespace_s_o_c_k_e_t_s_t_a_t_u_s.html#a960fa087f22eb32da3c7d0c805be7876a5a76b20cc3c857f53d6e5e7e817c8959">SOCKETSTATUS::UNINIT</a></div><div class="ttdoc">未初始化</div><div class="ttdef"><b>Definition:</b> <a href="_socket_def_8h_source.html#l00087">SocketDef.h:87</a></div></div>
<div class="ttc" id="aclass_client_html_ac9ef3d3342a564f93d6d94ee795a28c0"><div class="ttname"><a href="class_client.html#ac9ef3d3342a564f93d6d94ee795a28c0">Client::_cliSock</a></div><div class="ttdeci">SharedPtr&lt; CTcpIoSocket &gt; _cliSock</div><div class="ttdef"><b>Definition:</b> <a href="_client_8h_source.html#l00103">Client.h:103</a></div></div>
<div class="ttc" id="aclass_service_html_a83c9735b06c1d6bd177cb0b8d04ce038"><div class="ttname"><a href="class_service.html#a83c9735b06c1d6bd177cb0b8d04ce038">Service::_isServer</a></div><div class="ttdeci">bool _isServer</div><div class="ttdoc">服务端标志</div><div class="ttdef"><b>Definition:</b> <a href="_service_8h_source.html#l00116">Service.h:116</a></div></div>
<div class="ttc" id="aclass_tcp_config_html_aeea34692ee7ba49257448a3088d73b61"><div class="ttname"><a href="class_tcp_config.html#aeea34692ee7ba49257448a3088d73b61">TcpConfig::_family</a></div><div class="ttdeci">SOCKFAMILY::SockFamily _family</div><div class="ttdoc">ip协议 默认IPV4</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_conf_8h_source.html#l00036">TcpConf.h:36</a></div></div>
<div class="ttc" id="aclass_service_html_aceb078ac7bb78b45f21e0a3d2bf79735"><div class="ttname"><a href="class_service.html#aceb078ac7bb78b45f21e0a3d2bf79735">Service::AddClient</a></div><div class="ttdeci">void AddClient(const SharedPtr&lt; Client &gt; &amp;c)</div><div class="ttdoc">增加客户端</div><div class="ttdef"><b>Definition:</b> <a href="_service_8cpp_source.html#l00049">Service.cpp:49</a></div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.16
</small></address>
</body>
</html>
